package com.vunguyen.model;
// Generated Nov 29, 2014 7:36:58 AM by Hibernate Tools 3.6.0


import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * Canbo generated by hbm2java
 */
@Entity
@Table(name="canbo"
    ,catalog="qlkhoacntt"
)
public class Canbo  implements java.io.Serializable {


     private int idCanBo;
     private Giangvien giangvien;
     private String tenCanBo;
     private String email;
     private Date ngaySinh;
     private String password;
     private int quyen;

    public Canbo() {
    }

	
    public Canbo(Giangvien giangvien, String password, int quyen) {
        this.giangvien = giangvien;
        this.password = password;
        this.quyen = quyen;
    }
    public Canbo(Giangvien giangvien, String tenCanBo, String email, Date ngaySinh, String password, int quyen) {
       this.giangvien = giangvien;
       this.tenCanBo = tenCanBo;
       this.email = email;
       this.ngaySinh = ngaySinh;
       this.password = password;
       this.quyen = quyen;
    }
   
    @GenericGenerator(name="generator", strategy="foreign", parameters=@Parameter(name="property", value="giangvien"))@Id @GeneratedValue(generator="generator")

    
    @Column(name="idCanBo", unique=true, nullable=false)
    public int getIdCanBo() {
        return this.idCanBo;
    }
    
    public void setIdCanBo(int idCanBo) {
        this.idCanBo = idCanBo;
    }

@OneToOne(fetch=FetchType.EAGER)@PrimaryKeyJoinColumn
    public Giangvien getGiangvien() {
        return this.giangvien;
    }
    
    public void setGiangvien(Giangvien giangvien) {
        this.giangvien = giangvien;
    }

    
    @Column(name="TenCanBo", length=50)
    public String getTenCanBo() {
        return this.tenCanBo;
    }
    
    public void setTenCanBo(String tenCanBo) {
        this.tenCanBo = tenCanBo;
    }

    
    @Column(name="Email", length=50)
    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="NgaySinh", length=10)
    public Date getNgaySinh() {
        return this.ngaySinh;
    }
    
    public void setNgaySinh(Date ngaySinh) {
        this.ngaySinh = ngaySinh;
    }

    
    @Column(name="Password", nullable=false, length=16)
    public String getPassword() {
        return this.password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }

    
    @Column(name="Quyen", nullable=false)
    public int getQuyen() {
        return this.quyen;
    }
    
    public void setQuyen(int quyen) {
        this.quyen = quyen;
    }




}


